<template>
	<van-popup
		position="top"
		:style="{ height: '70%' }"
		round
		v-model="show"
		:close-on-click-overlay="false"
	>
		<div class="container">
			<div class="main">
				<van-form>
					<van-field label="加微日期:">
						<template #input>
							<div style="width: 100%;">
								<SelectTimeList
									@checkTimeList="checkTimeList"
									:listDate="[search.wechat_join_btime, search.wechat_join_etime]"
								/>
							</div>
						</template>
					</van-field>
					<van-field
						label="客户关键字:"
						clearable
						v-model="search.search_content"
						placeholder="请输入客户关键字"
					>
					</van-field>
				</van-form>
			</div>
			<div class="footer">
				<van-button size="small" type="default" @click="show = false">取消</van-button>
				<van-button size="small" type="info" @click="confirm">确认</van-button>
			</div>
		</div>
	</van-popup>
</template>

<script>
import SelectTimeList from "@/components/selectTimeList.vue";
export default {
	components: {
		SelectTimeList
	},
	data() {
		return {
			show: false,
			search: {
				wechat_join_btime: "",
				wechat_join_etime: ""
			}
		};
	},
	created() {},
	mouted() {},
	methods: {
		open() {
			this.show = true;
		},
		setData(data) {
			this.search = this.$TOOL.objCopy(data);
		},
		checkTimeList(timeList) {
			this.search.wechat_join_btime = timeList[0];
			this.search.wechat_join_etime = timeList[1];
		},
		confirm() {
			this.$emit("resetSearch", this.search);
			this.show = false;
		}
	}
};
</script>
<style scoped lang="scss">
.container {
	height: 100%;
	// padding: 20px;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;

	.main {
		flex: 1;
	}

	.footer {
		height: 50px;
		display: flex;
		padding: 0px 16px;
		justify-content: space-between;
		align-items: center;
	}
}
</style>
